﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;

namespace IDAL
{
    /// <summary>
    /// Interface for order management
    /// </summary>
    public interface IOrder
    {
        /// <summary>
        /// Get order according to the order id
        /// </summary>
        /// <param name="orderId">Order Id</param>
        /// <returns>Order</returns>
        OrderInfo SelectOrder(int orderId);

        /// <summary>
        /// Get orders according to the username
        /// </summary>
        /// <param name="username">User Name</param>
        /// <returns>Collection of orders</returns>
        IList<OrderInfo> SelectByUsername(string username);

        /// <summary>
        /// Get orders according to the order state
        /// </summary>
        /// <param name="state">Order State</param>
        /// <returns>Collection of orders</returns>
        IList<OrderInfo> SelectByState(int state);

        /// <summary>
        /// Add an order
        /// </summary>
        /// <param name="order">The Order</param>
        void InsertOrder(OrderInfo order);

        /// <summary>
        /// Deal the order, change the order state
        /// </summary>
        /// <param name="order">The order</param>
        void DealOrder(int orderId);

        /// <summary>
        /// Delete the order
        /// </summary>
        /// <param name="orderId">Order Id</param>
        void CancelOrder(int orderId);
    }
}
